package com.sur.controller;


import com.sur.pojo.Dept;
import com.sur.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * ClassName: DeptController
 * Description:
 */

@RestController
@RequestMapping("/dept")
public class DeptController {
    @Autowired
    private DeptService deptService;

    @GetMapping
    public List<Dept> getAll(){
        return deptService.list();
    }

    @GetMapping("getById/{deptNo}")
    public Dept getOne(@PathVariable int deptNo){
        return deptService.getById(deptNo);
    }


}
